<?php
/**
* $Header: /cvsroot/phpbinder/binder/admin/editusers.php,v 1.1 2004/08/14 22:02:33 vidluther Exp $
* +----------------------------------------------------------------------+
* | $Revision: 37 $                                                         |
* +----------------------------------------------------------------------+
* | Copyright (c) 2000-2004 Linuxpowered, Inc                            |
* +----------------------------------------------------------------------+
* | Author: Vidyut Luther <vid@linuxpowered.com>                         |
* +----------------------------------------------------------------------+
* 
**/



$section = "ADMIN";

 
require_once '../global.inc.php'; 
require_once INCLUDE_PATH . '/USER.class.php'; 


$userid = $_GET['id']; 
$action = $_GET['action']; 


if("delete" == $action) {
  
  $sql = "DELETE FROM fqdn WHERE user='$userid'"; 
  $db->mInsert($sql); 
  unset($sql);  
  $sql = "DELETE FROM users where userid='$userid'"; 
  $db->mInsert($sql); 
  
  $loc = WEB_BASE . "admin/userlist.php"; 
  header("Location: $loc"); 

}
$userlevel = $_SESSION['userlevel']; 
$curuser = $_SESSION['USERID']; 



$objUser =& new User();



$objUser->setUserId($userid); 

$arrUsers = $objUser->LoadUser($userid);  

/*
$sql = "SELECT fqdnid,fqdn from fqdn where user='$userid'"; 
$rs = $db->mRun($sql) ; 

while($row=mysql_fetch_array($rs)) {
    $domains .= $row[1] . "\n" ; 
}*/



$useremail = $objUser->username;
$userpassword = $objUser->password; 
#$domains = $objUser->domains;  


$firstname = $arrUsers[0][firstname]; 
$lastname = $arrUsers[0][lastname]; 
$userpassword = $arrUsers[0][password];
$tpl->assign("userid",$userid);  
$tpl->assign("userfirst",$firstname); 
$tpl->assign("userlast",$lastname); 
$tpl->assign("useremail",$useremail); 
$tpl->assign("userpassword",$userpassword); 
$tpl->assign("mode","modify"); 

$tpl->display('userselect.html'); 
$tpl->display('adduser.html'); 
?>
